package com.zb.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @author zhs
 * @create 2020-07-22-11:33
 */
public class Book implements Serializable {

    private Integer id;
    private String bookname;
    private  String author;
    private  Double price;
    @JsonFormat(pattern="yyyy-MM-dd")//服务器到浏览器
    @DateTimeFormat(pattern = "yyyy-MM-dd")//浏览器到服务器
    private Date publishDate;

    public Book() {

    }

    public Book(String bookname, String author, Double price, Date publishDate) {
        this.bookname = bookname;
        this.author = author;
        this.price = price;
        this.publishDate = publishDate;
    }

    public Book(Integer id, String bookname, String author, Double price, Date publishDate) {
        this.id = id;
        this.bookname = bookname;
        this.author = author;
        this.price = price;
        this.publishDate = publishDate;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getBookname() {
        return bookname;
    }

    public void setBookname(String bookname) {
        this.bookname = bookname;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public Date getPublishDate() {
        return publishDate;
    }

    public void setPublishDate(Date publishDate) {
        this.publishDate = publishDate;
    }
}
